package com.ruoyi.order.service.impl;

import java.util.List;

import com.ruoyi.order.form.OrderInitvo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.VehicleOrderMapper;
import com.ruoyi.order.domain.VehicleOrder;
import com.ruoyi.order.service.IVehicleOrderService;

/**
 * 订单管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class VehicleOrderServiceImpl implements IVehicleOrderService 
{
    @Autowired
    private VehicleOrderMapper vehicleOrderMapper;

    /**
     * 查询订单管理
     * 
     * @param id 订单管理主键
     * @return 订单管理
     */
    @Override
    public VehicleOrder selectVehicleOrderById(Long id)
    {
        return vehicleOrderMapper.selectVehicleOrderById(id);
    }

    /**
     * 查询订单管理列表
     * 
     * @param vehicleOrder 订单管理
     * @return 订单管理
     */
    @Override
    public List<VehicleOrder> selectVehicleOrderList(VehicleOrder vehicleOrder)
    {
        return vehicleOrderMapper.selectVehicleOrderList(vehicleOrder);
    }

    /**
     * 新增订单管理
     * 
     * @param vehicleOrder 订单管理
     * @return 结果
     */
    @Override
    public int insertVehicleOrder(VehicleOrder vehicleOrder)
    {
        return vehicleOrderMapper.insertVehicleOrder(vehicleOrder);
    }

    /**
     * 修改订单管理
     * 
     * @param vehicleOrder 订单管理
     * @return 结果
     */
    @Override
    public int updateVehicleOrder(VehicleOrder vehicleOrder)
    {
        return vehicleOrderMapper.updateVehicleOrder(vehicleOrder);
    }

    /**
     * 批量删除订单管理
     * 
     * @param ids 需要删除的订单管理主键
     * @return 结果
     */
    @Override
    public int deleteVehicleOrderByIds(Long[] ids)
    {
        return vehicleOrderMapper.deleteVehicleOrderByIds(ids);
    }

    /**
     * 删除订单管理信息
     * 
     * @param id 订单管理主键
     * @return 结果
     */
    @Override
    public int deleteVehicleOrderById(Long id)
    {
        return vehicleOrderMapper.deleteVehicleOrderById(id);
    }

    @Override
    public int initOrder(OrderInitvo orderInitvo) {

        return vehicleOrderMapper.insertVehicleOrder(orderInitvo);
    }

    @Override
    public VehicleOrder getOrderById(Long id) {
        return vehicleOrderMapper.getOrderById(id);
    }

    @Override
    public void updateOrderStatus(VehicleOrder vehicleOrder) {
        vehicleOrderMapper.updateOrderStatus(vehicleOrder);
    }
}
